﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using IntroduceCompany.Models;

namespace IntroduceCompany.Singleton
{
    public class DataSingleton
    {
        private static DataLinQDataContext _instance;

        private static GeneralModels _generalModels;
        private static LanguageModels _languageModels;
        private static MenuListModels _menuListModels;
        private static ArticleModels _articleModels;

        private static ProductModels _productModels;
        private static AlbumModels _albumModels;
        private static AdminModels _adminModels;
        private static RoleModels _roleModels;

        private static GenderModels _genderModels;
        private static VideoModels _videoModels;
        private static CompanyInformationModels _companyInformationModels;
        private static FeedbackModels _feedbackModels;

        private static CompanyMemberModels _companyMemberModels;
        private static SurveyModels _surveyModels;
        private static OrderModels _orderModels;
        private static BossEmailModels _bossEmailModels;

        public static DataLinQDataContext GetInstance()
        {
            if (_instance == null)
            {
                _instance = new DataLinQDataContext();
            }
            return _instance;
        }


        public static DataLinQDataContext RefeshInstance()
        {
            _instance = new DataLinQDataContext();
            return _instance;
        }


        public static GeneralModels GetGeneralModels()
        {
            if (_generalModels == null)
            {
                _generalModels = new GeneralModels();
            }
            return _generalModels;
        }

        public static LanguageModels GetLanguageModels()
        {
            if (_languageModels == null)
            {
                _languageModels = new LanguageModels();
            }
            return _languageModels;
        }

        public static MenuListModels GetMenuListModels()
        {
            if (_menuListModels == null)
            {
                _menuListModels = new MenuListModels();
            }
            return _menuListModels;
        }

        internal static ArticleModels GetArticleModels()
        {
            if (_articleModels == null)
            {
                _articleModels = new ArticleModels();
            }
            return _articleModels;
        }

        public static ProductModels GetProductModels()
        {
            if (_productModels == null)
            {
                _productModels = new ProductModels();
            }
            return _productModels;
        }

        internal static AlbumModels GetAlbumModels()
        {
            if (_albumModels == null)
            {
                _albumModels = new AlbumModels();
            }
            return _albumModels;
        }

        public static AdminModels GetAdminModels()
        {
            if (_adminModels == null)
            {
                _adminModels = new AdminModels();
            }
            return _adminModels;
        }

        public static RoleModels GetRoleModels()
        {
            if (_roleModels == null)
            {
                _roleModels = new RoleModels();
            }
            return _roleModels;
        }

        public static GenderModels GetGenderModels()
        {
            if (_genderModels == null)
            {
                _genderModels = new GenderModels();
            }
            return _genderModels;
        }


        internal static VideoModels GetVideoModels()
        {
            if (_videoModels == null)
            {
                _videoModels = new VideoModels();
            }
            return _videoModels;
        }


        internal static CompanyInformationModels GetCompanyInformationModels()
        {
            if (_companyInformationModels == null)
            {
                _companyInformationModels = new CompanyInformationModels();
            }
            return _companyInformationModels;
        }

        internal static FeedbackModels GetFeedbackModels()
        {
            if (_feedbackModels == null)
            {
                _feedbackModels = new FeedbackModels();
            }
            return _feedbackModels;
        }

        internal static CompanyMemberModels GetCompanyMemberModels()
        {
            if (_companyMemberModels == null)
            {
                _companyMemberModels = new CompanyMemberModels();
            }
            return _companyMemberModels;
        }

        public static SurveyModels GetSurveyModels()
        {
            if (_surveyModels == null)
            {
                _surveyModels = new SurveyModels();
            }
            return _surveyModels;
        }

        public static OrderModels GetOrderModels()
        {
            if (_orderModels == null)
            {
                _orderModels = new OrderModels();
            }
            return _orderModels;
        }

        public static BossEmailModels GetBossEmailModels()
        {
            if (_bossEmailModels == null)
            {
                _bossEmailModels = new BossEmailModels();
            }
            return _bossEmailModels;
        }

    }
}